package com.example.hello_world.thread;

import java.util.concurrent.Callable;

public class newThread {
    public static void main(String[] args) {
        //Thread的线程
//        Mythread thread=new Mythread();
//        thread.start();
        //匿名类方式
        new Thread(new Mythread(){
            @Override
            public void run() {
                doSomething();
            }
        }).start();

//2.runnable的使用
        runThread runThread = new runThread();
        Thread thread = new Thread(runThread);
        thread.start();

        doSomething();


    }
    public static void doSomething(){
        System.out.println("我是主线程的程序");
    };

}
